<?php

$avatar = $user['Image'];
$group = $user['UserGroup'];
$topicGroups = $user['UserTopicGroup'];
$user = $user['User'];
?>
<h2> <?php echo $this->Display->getText($user, 'User');?> </h2>
<table>
    <caption>
        Informations
    </caption>
    <tbody>
        <tr>
            <td>
                Nom
            </td>
            <td>
                <?php echo $user['name'];?>
            </td>
        </tr>
        <tr>
            <td>
                Prénom 
            </td>
            <td>
                <?php echo $user['surname'];?>
            </td>
        </tr>
        <tr>
            <td>
                Email
            </td>
            <td>
                <?php echo $user['email'];?>
            </td>
        </tr>
        <tr>
            <td>
                Avatar
            </td>
            <td>
                <?php echo $this->Display->avatar($avatar, $user);?>
      
            </td>
        </tr>
        
        <tr>
            <td>
                Groupe 
            </td>
            <td>
                <?php
                    if (!empty($group)){
                        echo $this->Display->link($group['Group'], 'Group');
                    }
                    else{
                        echo 'Aucun groupe';
                    }
                ?>
            </td>
        </tr>
        
        
        <tr>
            <td>
                Groupe à thème 
            </td>
            <td>
                <?php
                    /*
                    if (!empty($topicGroups)){
                        foreach ($topicGroups as $topicGroup){
                            debug($topicGroup);
                        }
                    }
                    else{
                        echo 'Aucun groupe à thème';
                    }
                     * 
                     */
                ?>
            </td>
        </tr>
        
        
    </tbody>
</table>
